function dataHander(act, theUrl, objItem, str){
	var id = "";
	var msg1 = "没有可";
	if (objItem != null){
		if(!objItem.length) objItem = document.getElementsByName("itemselect");
		for(var i=0;i<objItem.length;i++){
			if(objItem[i].checked == true){
				id+=objItem[i].value+",";
			}
		}
		if(id.lastIndexOf(",") == (id.length-1)){
			id = id.substring(0, id.length-1);
		}

		msg1 = "请选中要";
	}
	str = (str != undefined)?str:""

	switch(act){
		case "WebEditorJSP":
			popUpWindow(theUrl, 800, 550);
			break;
		case "add":
			popUpWindow(theUrl+str, 650, 520);
			break;
		case "delete":
			if (!id){alert(msg1+"删除的项目！");return false}
			if(!confirm("您确认要删除吗?")) return false;
			popUpWindow(theUrl+id, 0, 0);
			break;
		case "signature":
			if (!id){alert(msg1+"签名的项目！");return false}
			popUpWindow(theUrl+id, 0, 0);
			break;
		case "date":
			if (!id){alert(msg1+"操作的项目！");return false}
			popUpWindow(theUrl+id, 380, 300);
			break;
		case "modify":
			if (id == false){alert(msg1+"修改的项目！");return false}
			if(id.indexOf(",") > -1){alert("不能同时修改多项！");return false}
			popUpWindow(theUrl+id, 650, 520);
			break;
		case "audit":
			if (id == false){alert(msg1+"审核的用户！");return false}
			popUpWindow(theUrl+id, 0, 0);
			break;
		case "sms":
			popUpWindow(theUrl+id, 0, 0);
			break;
		case "exportin":
			popUpWindow(theUrl, 500, 320);
			break;
		case "exportout":
			popUpWindow(theUrl+id, 500, 320);
			break;
		case "allocation":
			if(!id){alert(msg1+"分配的客户！");return false}
			openUser(id);
			break;
	}
	return false;
}

function exportWindow(URLStr){
	popUpWindow(URLStr, 500, 320);
}

function popUpWindow(URLStr, width, height){
	window.open(URLStr, "", fnGetWinStatus(width, height));
/*
	if(width == undefined && height == undefined){
          event.srcElement.openwin = open(URLStr);
          event.srcElement.openwin.focus();
    }else{
	      	var left = (screen.width - width)/2;
	        var top = (screen.height - height)/2;

            event.srcElement.openwin = open(URLStr,"","width= "+width+ ",height="+height+",left="+left+",top="+top);
            event.srcElement.openwin.focus();
	}
*/
}

function selectAction(key){
	var tags = document.all[key];
	if(tags){
		var src = event.srcElement;
	 	for(var i=0;i<tags.length;i++){
			tags[i].checked = src.checked;
	 	}
 	}
}

function setDivHeight(name, Height){
    var divList = document.getElementById(name);
	if(!divList) return false;
    var div_resize = function(){
		divList.style.height = document.body.clientHeight+Height+"px";
	}
	div_resize();
	window.onresize = div_resize;
}

function goPage(type){
	var pageNo = document.getElementById("page_no");
	pageNo.value = pageNo.value.replace(/\D/g,'');
	if(type == "jump"){
		if(pageNo.value == "") return false;
		document.getElementById("page_action").value = "SPECIAL_PAGE";
	}else{
		document.getElementById("page_action").value = type;
	}
	document.all.viewForm.submit();
}

function checkData(obj){
	if(!Validator.Validate(obj,3))return false;
	locking();
	document.getElementById("myLoad").innerHTML = "<img src='images/loading.gif' alt='数据保存中' class='icon1' border='0' align='absmiddle'/> 数据保存中,请稍后......";
    return true;
}

function locking(){
	document.all.ly.style.display="block";
	document.all.ly.style.width=document.body.clientWidth;
	document.all.ly.style.height=document.body.clientHeight;
	document.all.Layer2.style.display="block";
	return true;
}

function unLock(){
	document.all.ly.style.display="none";
	document.all.Layer2.style.display="none";
	return false;
}